<template>
	<view class="page">
		<navbar backIconName="arrow-left" title="进入企业任务详情" :delta="delta" :titleStyle="titleStyle"></navbar>
		<scroll-view class="scroll-view_H" scroll-y="true">
			<view :style="{height:statusHeight+'px'}"></view>
			<view class="staff-card">
				<view class="left">
					<view class="top">
						<text
							style="font-size: 30rpx;color: #323232;font-weight: bold;margin-right: 20rpx;">{{enterpriseTask.taskName || '-'}}
						</text>
					</view>
					<view class="bottom">
						<text class="status" v-if="enterpriseTask.status == 0">待入企</text>
						<text class="status" style="background-color: rgba(255, 192, 1, 1);"
							v-else-if="enterpriseTask.status == 1">已入企</text>
						<text class="status" style="background-color: rgba(214, 32, 32, 1);"
							v-else-if="enterpriseTask.status == 2">待企业评价</text>
						<text class="status" style="background-color: rgba(54, 185, 0, 1);" v-else>已评价</text>
						<!-- <text class="status" style="background-color: rgba(214, 32, 32, 1);" v-else>已结束</text> -->
						<text style="font-size: 26rpx;color: #666;">{{enterpriseTask.createTime || '-'}}</text>
					</view>
				</view>
			</view>

			<view class="inCompany-task">
				<view class="task-item" style="margin-bottom: 20rpx;" v-for="(item,index) in enterpriseTaskPersonnels"
					:key="index">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">
								{{'入企人员信息'+(index+1)}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">姓名</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{item.lawEnforcerName || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">人员类型</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{item.personnelCategory || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">证件编号</text>
							<text style="flex: 1; font-size: 28rpx;color: #666666;">{{item.idNumber || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">所在单位</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{item.departmentName || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;border: none;">
							<text class="label-content">职务/职级</text>
							<text style="flex: 1; font-size: 28rpx;color: #666666;">{{item.post || '-'}}</text>
						</view>

					</view>

				</view>

			</view>


			<view class="inCompany-task" style="padding-top: 0px;">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">企业信息</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">企业名称</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.companyName || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;align-items: center;">
							<view style="display: flex;flex-direction: column;">
								<text class="label-content">统一社会</text>
								<text class="label-content">信用代码</text>
							</view>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.socialCreditNumber || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">所属行业</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.industryType || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">联系人</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.contacts || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;border: none;">
							<text class="label-content">联系电话</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.contactNumber || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;border: none;">
							<text class="label-content">地址</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.addressName || '-'}}</text>
						</view>

					</view>

				</view>

			</view>

			<view class="inCompany-task" v-if="enterpriseTask.status != 0 && staffFeedbackList.length > 0"
				style="padding-top: 0px;">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">节点告知</text>
						</view>
						<u-line></u-line>
						<view style="height: 20rpx;"></view>
						<view style="display: flex;" v-for="(item,index) in staffFeedbackList" :key="index">
							<view class="time-line">
								<div class="dot" :class="[index == '0'?'active':'normal',]"></div>
								<div v-if="index != staffFeedbackList.length-1" class="lines"></div>
							</view>
							<view style="flex: 1;">
								<view class="top">
									<text
										style="font-size: 28rpx;color: #323232;font-weight: bold;">{{item.userName || '-'}}</text>
									<text
										style="margin-left: 10px; background-color: #ab8500; font-size: 24rpx;color: #fff;padding: 3px 5px;border-radius: 5px;">执法人员</text>
									<text
										style="flex: 1; font-size: 28rpx;color: #666666;text-align: right;">{{item.createTime || '-'}}</text>
								</view>
								<view class="top" style="padding-top: 20rpx;">
									<text
										style="flex: 1; font-size: 28rpx;color: #666666;">{{item.feedbackComment || '-'}}</text>
								</view>
								<u-line></u-line>
								<template v-if="item.feedbackFile.length > 0">
									<view class="top" style="padding-top: 20rpx;">
										<view style="flex: 1;overflow: hidden;">
											<view style="padding: 10rpx 0rpx;" v-for="(a,aIndex) in item.feedbackFile"
												:key="aIndex">
												<view style="display: flex;align-items: center;" :data-params="a"
													@click="downloadPreview">
													<text
														style="flex: 1;padding-right: 10rpx; font-size: 28rpx;color: #666666;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{a.fileName}}</text>
													<u-icon name="eye" size="21"></u-icon>
												</view>

											</view>

										</view>
									</view>
									<u-line></u-line>
								</template>
								<view style="height: 20rpx;"></view>

							</view>

						</view>
					</view>

				</view>

			</view>
			<view class="inCompany-task" style="padding-top: 0px;">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">入企信息</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">入企类型</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.taskTypeName || '-'}}</text>
						</view>
						<!-- <u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">计划入企日期</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.enterprisePlanDate || '-'}}</text>
						</view> -->
						<!-- <u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">拟开始时间</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.planStartTime || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">拟结束时间</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.planEndTime || '-'}}</text>
						</view> -->
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">入企人数</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTaskPersonnels.length || '0'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">备注</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.enterpriseContent || '-'}}</text>
						</view>
						<u-line></u-line>
						<template v-if="enterpriseTask.taskTypeCode == '1' && auditAttachmentVos.length > 0">
							<view class="top" style="padding-top: 20rpx;">
								<text class="label-content">审批材料</text>
								<view style="flex: 1;overflow: hidden;">
									<view style="padding-bottom: 20rpx;" v-for="(item,index) in auditAttachmentVos"
										:key="index">
										<view style="display: flex;align-items: center;" :data-params="item"
											@click="downloadPreview">
											<text
												style="flex: 1;padding-right: 10rpx; font-size: 28rpx;color: #666666;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.fileName}}</text>
											<u-icon name="eye" size="21"></u-icon>
										</view>

									</view>

								</view>
							</view>
							<u-line></u-line>
						</template>
						<template v-if="enterpriseTask.taskTypeCode == '1'">
							<view class="top" style="padding-top: 20rpx;">
								<text class="label-content">检查事项</text>
								<text style="flex: 1; font-size: 28rpx;color: #666666;"></text>
							</view>
							<view class="file-content">
								<view class="item" v-for="(item,index) in mattersOptions" :key="index">
									<text>{{(index + 1) + '，'}}</text>
									<text class="txt">{{item.itemName}}</text>
									<view @click="toMattersDetail(item)">
										<u-icon name="arrow-right" color="#323232" size="18"></u-icon>
									</view>
								</view>
							</view>
							<u-line></u-line>
						</template>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">开始时间</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{ enterpriseTask.enterpriseTime || '-'}}</text>
						</view>
						<u-line></u-line>
						<template
							v-if="enterpriseTask.status == 2 || enterpriseTask.status == 3 || enterpriseTask.status == 4">
							<view class="top" style="padding-top: 20rpx;">
								<text class="label-content">结束时间</text>
								<text
									style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTask.enterpriseEndTime || '-'}}</text>
							</view>
							<u-line></u-line>
							<view class="top" style="padding-top: 20rpx;">
								<text class="label-content">入企人数</text>
								<text
									style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseTaskPersonnels.length || '0'}}</text>
							</view>
							<u-line></u-line>
						</template>
						<template v-if="enterpriseTask.status == 1 && userInfo.isEnterprise">
							<u--form ref="uForm" labelPosition="left" :model="formData" :rules="rules" labelWidth="90"
								:labelStyle="labelStyle">
								<u-form-item label="结束时间" prop="enterpriseEndTime" borderBottom @click="selectOverTime">
									<u--input v-model="formData.enterpriseEndTime" disabled disabledColor="#ffffff"
										placeholder="请选择" border="none"></u--input>
									<u-icon slot="right" name="arrow-right"></u-icon>
								</u-form-item>
								<!-- <u-form-item label="入企人数" prop="peoples" borderBottom>
									<u--input v-model="formData.peoples" type="idcard" placeholder="请输入入企人数"
										maxlength="18" border="none"></u--input>
								</u-form-item> -->
							</u--form>
						</template>
					</view>
				</view>
			</view>

			<!-- 一键反馈内容 -->
			<view class="inCompany-task" v-if="feedbackList.length > 0 && !userInfo.isEnterprise"
				style="padding-top: 0px;">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">一键反馈信息</text>
						</view>
						<u-line></u-line>
						<view v-for="(a,aIndex) in feedbackList" :key="aIndex">
							<view class="top" style="padding-top: 20rpx;">
								<text>{{(aIndex + 1 +'，')}}</text>
								<text class="label-content">反馈类型</text>
								<text style="flex: 1; font-size: 28rpx;color: #666666;">{{a.feedbackType || '-'}}</text>
							</view>
							<u-line></u-line>
							<view class="top" style="padding-top: 20rpx;">
								<text style="opacity: 0;">{{(aIndex + 1 +'，')}}</text>
								<text class="label-content">反馈事项</text>
								<text
									style="flex: 1; font-size: 28rpx;color: #666666;">{{a.feedbackMatter || '-'}}</text>
							</view>
							<u-line></u-line>
							<view class="top" style="padding-top: 20rpx;">
								<text style="opacity: 0;">{{(aIndex + 1 +'，')}}</text>
								<text class="label-content">备注</text>
								<text style="flex: 1; font-size: 28rpx;color: #666666;">{{a.remarks || '-'}}</text>
							</view>
							<u-line></u-line>
							<view class="top" style="padding-top: 20rpx;">
								<text style="opacity: 0;">{{(aIndex + 1 +'，')}}</text>
								<text class="label-content">附件</text>
								<view style="flex: 1;overflow: hidden;">
									<view style="padding-bottom: 20rpx;" v-for="(item,index) in a.attachmentUrl"
										:key="index">
										<view style="display: flex;align-items: center;" :data-params="item"
											@click="downloadPreview">
											<text
												style="flex: 1;padding-right: 10rpx; font-size: 28rpx;color: #666666;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.fileName}}</text>
											<u-icon name="eye" size="21"></u-icon>
										</view>
									</view>
								</view>
							</view>
							<u-line></u-line>
						</view>

					</view>
				</view>
			</view>



			<view class="inCompany-task" v-if="enterpriseTask.status == 3">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">评价反馈</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">评价人</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseAppraise.createBy || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">反馈时间</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseAppraise.createTime || '-'}}</text>
						</view>
						<u-line></u-line>
						<!-- <view class="top" style="padding-top: 20rpx;">
							<text class="label-content">入企规范度</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseAppraise.standardizationLevel || '-'}}</text>
						</view>
						<u-line></u-line> -->
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">入企满意度</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseAppraise.satisfactionLevel || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">备注</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{enterpriseAppraise.comment || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">附件</text>
							<view style="flex: 1;overflow: hidden;">
								<view style="padding-bottom: 20rpx;" v-for="(item,index) in enterpriseAttachmentVos"
									:key="index">
									<view style="display: flex;align-items: center;" :data-params="item"
										@click="downloadPreview">
										<text
											style="flex: 1;padding-right: 10rpx; font-size: 28rpx;color: #666666;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.fileName}}</text>
										<u-icon name="eye" size="21"></u-icon>
									</view>

								</view>

							</view>
						</view>
					</view>
				</view>
			</view>

			<view v-if="enterpriseTask.status == 2 && !userInfo.isEnterprise" class="inCompany-task">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">评价反馈</text>
						</view>
						<u-line></u-line>
						<u--form ref="uForm2" labelPosition="left" :model="formData2" :rules="rules2" labelWidth="90"
							:labelStyle="labelStyle">
							<!-- <u-form-item label="入企规范度" prop="standardizationLevel" borderBottom @click="openGfd">
								<u--input v-model="formData2.standardizationLevel" disabled disabledColor="#ffffff"
									placeholder="请选择" border="none"></u--input>
								<u-icon slot="right" name="arrow-right"></u-icon>
							</u-form-item> -->
							<u-form-item label="入企满意度" prop="satisfactionLevel" borderBottom @click="openMyd">
								<u--input v-model="formData2.satisfactionLevel" disabled disabledColor="#ffffff"
									placeholder="请选择" border="none"></u--input>
								<u-icon slot="right" name="arrow-right"></u-icon>
							</u-form-item>
							<u-form-item label="备注" prop="comment" borderBottom>
								<u--textarea v-model="formData2.comment" :showConfirmBar="false" :adjustPosition="true"
									placeholder="请输入其它反馈"></u--textarea>
							</u-form-item>
							<u-form-item label="附件">
								<view
									style="font-size: 26rpx; display: flex;align-items: center;justify-content: space-between;">
									<text style="font-size: 22rpx;">最多支持5个文件，最大2M</text>
									<text class="custom-button" @click="selectFile">新增附件</text>
								</view>
							</u-form-item>
							<!-- <uni-file-picker limit="2" file-mediatype="all" title="最多选择5个文件" @select="select">
							</uni-file-picker> -->
							<view class="file-content">
								<view class="item" v-for="(item,index) in fileList" :key="index">
									<text>{{item.name}}</text>
									<u-icon name="close" @click="del(item,index)"></u-icon>
								</view>
							</view>
						</u--form>

					</view>

				</view>

			</view>

			<view v-if="enterpriseTask.status == 1 && userInfo.isEnterprise"
				style="height: 44px;display: flex;align-items: center;">
				<u-button type="primary" :throttleTime="1000" text="结束任务" @click="submitTaskOver"></u-button>
			</view>
			<view v-if="enterpriseTask.status == 2 && !userInfo.isEnterprise"
				style="height: 44px;display: flex;align-items: center;">
				<u-button type="primary" :throttleTime="1000" text="提交" @click="submitApprise"></u-button>
			</view>

		</scroll-view>
		<!-- 结束时间-->
		<u-datetime-picker v-model="overTime" ref="datetimePicker" :minDate="minDate" :show="showEndTime"
			mode="datetime" @cancel="closeOverTime" @confirm="endTimeBack"></u-datetime-picker>

		<!-- 入企规范度-->
		<u-action-sheet :show="showGfd" :actions="actionsGfd" round="12" title="请选择入企规范度" @close="closeGfd"
			@select.stop="typeSelectGfd">
		</u-action-sheet>

		<!-- 入企满意度 -->
		<u-action-sheet :show="showMyd" :actions="actionsMyd" round="12" title="请选择入企满意度" @close="closeMyd"
			@select.stop="typeSelectMyd">
		</u-action-sheet>

		<!-- loading -->
		<u-overlay :show="showLoading" :opacity="0.8">
			<view class="warp">
				<text style="font-size: 28rpx;color: #fff;">{{loadingTips}}</text>
			</view>
		</u-overlay>

		<!-- 企业人员一键反馈-->
		<liu-drag-button v-if="!userInfo.isEnterprise && userInfo.isAuthentication" @clickBtn="toFeedBack"
			:rightPx="30">
			<view class="one-key-feedback">
				<text>一键</text>
				<text>反馈</text>
			</view>
		</liu-drag-button>

		<!-- 入企人员反馈 -->
		<liu-drag-button v-if="userInfo.isEnterprise && enterpriseTask.status != 0" @clickBtn="enterCompanyFeedBack"
			:rightPx="30" :bottomPx="30">
			<view class="one-key-feedback">
				<text>节点</text>
				<text>告知</text>
			</view>
		</liu-drag-button>

	</view>
</template>

<script>
	import {
		getEnterRecordDetais,
		enterFeedback,
	} from '@/api/pagesMine'
	import {
		overEnter,
		submitAppraise,
	} from '@/api/pagesMall'
	import {
		getTimeStamp,
		showConfirm,
		getSimpleDate,
	} from "@/utils/common.js"
	let App = getApp();
	import store from '@/store'
	import config from '@/api/config'
	export default {
		components: {},
		data() {
			return {
				showLoading: false,
				loadingTips: '加载中...',
				statusHeight: 44 + App.globalData.statusBarHeight,
				titleStyle: {
					color: "#ffffff",
					fontWeight: "bold",
					fontSize: "18px"
				},
				labelStyle: {
					color: "#323232",
					fontWeight: "bold",
					fontSize: "28rpx"
				},
				/* 结束入企 */
				formData: {
					enterpriseEndTime: "",
					enterpriseTaskNo: "",
					userId: "",
				},
				overTime: "",
				rules: {
					enterpriseEndTime: [{
						required: true,
						message: '请选择',
						trigger: ['blur']
					}],
				},
				formData2: {
					standardizationLevel: "",
					satisfactionLevel: "",
					comment: "",
				},
				rules2: {
					standardizationLevel: [{
						required: true,
						message: '请选择',
						trigger: ['blur']
					}],
					satisfactionLevel: [{
						required: true,
						message: '请选择',
						trigger: ['blur']
					}],

				},
				userId: store.state.user.USER_OPENID,
				userInfo: store.state.user.USER_INFO,
				enterpriseTaskNo: '',
				enterpriseTask: null,
				auditAttachmentVos: [],
				enterpriseTaskPersonnels: [],
				feedbackAttachmentVos: [],
				enterpriseAppraise: null,
				enterpriseAttachmentVos: [],
				staffFeedbackList: [],
				feedbackList: [],
				showEndTime: false,
				showMyd: false,
				showGfd: false,
				actionsMyd: [{
						name: '满意',
						id: '满意',
					},
					{
						name: '基本满意',
						id: '基本满意',
					},
					{
						name: '不满意',
						id: '不满意',
					}
				],
				actionsGfd: [{
						name: '非常满意',
						id: '非常满意',
					},
					{
						name: '满意',
						id: '满意',
					},
					{
						name: '基本满意',
						id: '基本满意',
					},
					{
						name: '不满意',
						id: '不满意',
					},
					{
						name: '非常不满意',
						id: '非常不满意',
					},
				],
				minDate: 0,
				fileList: [],
				fileListFeedBack: [],
				mattersOptions: [],
				delta: 1,
			};
		},
		onReady() {
			this.$refs.uForm.setRules(this.rules)
			this.$refs.uForm2.setRules(this.rules2)
		},
		onLoad(options) {
			if (options.delta == '1') {
				this.delta = 3
			}
			if (options.delta == '2') {
				this.delta = 4
			}
			this.minDate = new Date().getTime()
			// this.formData.enterpriseEndTime = this.$u.date(new Date(), 'yyyy-mm-dd hh:MM') + ':00'
			this.enterpriseTaskNo = options.enterpriseTaskNo
			this.getDetails()


		},
		methods: {
			/* 跳转入企事项详情 */
			toMattersDetail(item) {
				console.log(item)
				uni.navigateTo({
					url: '/pages-mall/pages/matters/detail?itemSubLists=' + item.itemStr
				})
			},
			/* 跳转一键反馈 */
			toFeedBack() {
				uni.navigateTo({
					url: '/pages-mine/pages/feedBack/index?enterpriseTaskNo=' + this.enterpriseTaskNo
				})
			},
			/* 跳转入企反馈 */
			enterCompanyFeedBack() {
				uni.navigateTo({
					url: '/pages-mine/pages/feedBackLawEnforcement/index?enterpriseTaskNo=' + this.enterpriseTaskNo
				})
			},
			/* 选择入企反馈文件 */
			selectFileFeedBack() {
				if (this.fileListFeedBack.length >= 5) {
					return uni.$u.toast('最多支持选择5个文件')
				}
				let fileType = ['pdf', 'doc', 'xlsx', 'docx', 'xls']
				uni.chooseMessageFile({
					count: 1, //默认100
					type: 'file',
					extension: fileType,
					success: (res) => {
						console.log(res)
						if (res.tempFiles[0].size > 1024 * 1024 * 2) {
							return uni.$u.toast('文件大小不能超过2M')
						}
						if (this.fileListFeedBack.find(item => item.name === res.tempFiles[0].name) !=
							undefined) {
							return uni.$u.toast('存在重复附件')
						}
						this.loadingTips = "上传中..."
						this.showLoading = true
						uni.uploadFile({
							url: config.baseUrl + '/enterprise/upload/uploadFile',
							filePath: res.tempFiles[0].path,
							name: 'file',
							formData: {
								fileName: res.tempFiles[0].name,
								userId: this.userId,
							},
							success: (uploadFileRes) => {
								this.showLoading = false
								let result = JSON.parse(uploadFileRes.data)
								if (result.code == 200 && result.data) {
									this.fileListFeedBack.push({
										name: result.data.fileName,
										url: result.data.url
									})
								} else {
									return uni.$u.toast('上传失败，请重新上传')
								}
							},
							fail: (error) => {
								this.showLoading = false
								return uni.$u.toast('上传失败，请重新上传')
							}
						});


					}
				})
			},
			delFeedBack(row, index) {
				this.fileListFeedBack.splice(index, 1)
			},
			/* 选择文件 */
			selectFile() {
				if (this.fileList.length >= 5) {
					return uni.$u.toast('最多支持选择5个文件')
				}
				let fileType = ['pdf', 'doc', 'xlsx', 'docx', 'xls']
				uni.chooseMessageFile({
					count: 1, //默认100
					type: 'file',
					extension: fileType,
					success: (res) => {
						console.log(res)
						if (res.tempFiles[0].size > 1024 * 1024 * 2) {
							return uni.$u.toast('文件大小不能超过2M')
						}
						if (this.fileList.find(item => item.name === res.tempFiles[0].name) != undefined) {
							return uni.$u.toast('存在重复附件')
						}
						this.loadingTips = "上传中..."
						this.showLoading = true
						uni.uploadFile({
							url: config.baseUrl + '/enterprise/upload/uploadFile',
							filePath: res.tempFiles[0].path,
							name: 'file',
							formData: {
								fileName: res.tempFiles[0].name,
								userId: this.userId,
							},
							success: (uploadFileRes) => {
								console.log('asdaggg', JSON.parse(uploadFileRes.data));
								this.showLoading = false
								let result = JSON.parse(uploadFileRes.data)
								if (result.code == 200 && result.data) {
									this.fileList.push({
										name: result.data.fileName,
										url: result.data.url
									})
								} else {
									return uni.$u.toast('上传失败，请重新上传')
								}
							},
							fail: (error) => {
								this.showLoading = false
								return uni.$u.toast('上传失败，请重新上传')
							}
						});


					}
				})
			},
			del(row, index) {
				this.fileList.splice(index, 1)
			},
			openGfd() {
				this.showGfd = true
			},
			closeGfd() {
				this.showGfd = false
			},
			openMyd() {
				this.showMyd = true
			},
			closeMyd() {
				this.showMyd = false
			},
			/* 下载 */
			downloadPreview(e) {
				console.log(e)
				this.loadingTips = "加载中..."
				this.showLoading = true
				uni.downloadFile({
					url: e.currentTarget.dataset.params.fileUrl, //文件地址
					success: (data) => {
						//打开文档查看
						uni.openDocument({
							filePath: data.tempFilePath,
							success: (res) => {
								this.showLoading = false
							},
							fail: (err) => {
								this.showLoading = false
								return uni.$u.toast('预览失败')
							}
						});
						// if (data.statusCode === 200) {
						// 	//文件保存到本地
						// 	uni.saveFile({
						// 		tempFilePath: data.tempFilePath, //临时路径
						// 		success: function(res) {
						// 			uni.showToast({
						// 				icon: 'none',
						// 				mask: true,
						// 				title: '文件已保存：' + res.savedFilePath, //保存路径
						// 				duration: 2000,
						// 			});
						// 			setTimeout(() => {
						// 				//打开文档查看
						// 				uni.openDocument({
						// 					filePath: res.savedFilePath,
						// 					success: function(res) {
						// 						// console.log('打开文档成功');
						// 					}
						// 				});
						// 			}, 2000)
						// 		}
						// 	});
						// }
					},
					fail: (err) => {
						this.showLoading = false
						return uni.$u.toast('预览失败')
					},
				});

			},
			getSimpleDate,
			/* 入企规范度回调参数 */
			typeSelectGfd(res) {
				console.log(res)
				this.formData2.standardizationLevel = res.id
				this.showGfd = false
			},
			/* 入企满意度回调参数 */
			typeSelectMyd(res) {
				this.formData2.satisfactionLevel = res.id
				this.showMyd = false
			},
			/* 提交评价 */
			submitApprise() {
				this.$refs.uForm2.validate().then(res => {
					let userid = store.state.user.USER_OPENID
					let params = {
						standardizationLevel: this.formData2.standardizationLevel,
						satisfactionLevel: this.formData2.satisfactionLevel,
						comment: this.formData2.comment,
						enterpriseTaskNo: this.enterpriseTask.enterpriseTaskNo,
						attachmentDtoList: [],
						userId: userid
					}
					let fileList = this.fileList.map(item => {
						return {
							fileName: item.name || '',
							fileUrl: item.url || '',
							type: '',
						}
					})
					params.attachmentDtoList = fileList
					showConfirm('确认要提交评价？').then(res => {
						if (res.confirm) {
							submitAppraise(params).then(res => {
								console.log(res)
								if (res.code == 200) {
									uni.$u.toast('评价成功！')
									this.getDetails()
								}

							});
						}
					})

				}).catch(errors => {

				});
			},
			// 获取上传状态
			select(e) {
				console.log('选择文件：', e)
			},
			// 获取上传状态
			select2(e) {
				console.log('选择文件：', e)
			},
			/* 提交结束任务 */
			submitTaskOver() {
				this.$refs.uForm.validate().then(res => {
					let userid = store.state.user.USER_OPENID
					let params = {
						enterpriseEndTime: this.formData.enterpriseEndTime,
						enterpriseTaskNo: this.enterpriseTask.enterpriseTaskNo,
						userId: userid
					}
					showConfirm('确认要结束入企任务？').then(res => {
						if (res.confirm) {
							overEnter(params).then(res => {
								console.log(res)
								if (res.code == 200) {
									uni.$u.toast('结束任务成功！')
									this.getDetails()
								}

							});
						}
					});

				}).catch(errors => {
					console.log(errors)
				})
			},
			getTimeStamp,
			endTimeBack(res) {
				this.formData.enterpriseEndTime = this.getTimeStamp(res.value) + ':00'
				this.showEndTime = false
			},
			selectOverTime() {
				this.showEndTime = true
			},
			closeOverTime() {
				this.showEndTime = false
			},
			/* 获取详情 */
			getDetails() {
				getEnterRecordDetais(this.enterpriseTaskNo).then(res => {
					console.log(res)
					if (res.data.auditAttachmentVos && res.data.auditAttachmentVos.length > 0) {
						this.auditAttachmentVos = res.data.auditAttachmentVos
					}
					if (res.data.enterpriseTask) {
						this.enterpriseTask = res.data.enterpriseTask
					}
					if (res.data.enterpriseTaskPersonnels && res.data.enterpriseTaskPersonnels.length > 0) {
						this.enterpriseTaskPersonnels = res.data.enterpriseTaskPersonnels
					}
					if (res.data.enterpriseAppraise) {
						this.enterpriseAppraise = res.data.enterpriseAppraise
					}
					if (res.data.enterpriseTask.enterpriseTime) {
						let time = this.getSimpleDate(res.data.enterpriseTask.enterpriseTime, 1)
						this.minDate = new Date(time).getTime()
						this.overTime = this.$u.date(new Date(time), 'yyyy-mm-dd hh:MM')
					}
					if (res.data.enterpriseAttachmentVos && res.data.enterpriseAttachmentVos.length > 0) {
						this.enterpriseAttachmentVos = res.data.enterpriseAttachmentVos
					}

					if (res.data.feedbackAttachmentVos && res.data.feedbackAttachmentVos.length > 0) {
						this.feedbackAttachmentVos = res.data.feedbackAttachmentVos
					}

					if (res.data.staffFeedbackList && res.data.staffFeedbackList.length > 0) {
						this.staffFeedbackList = res.data.staffFeedbackList.map(item => {
							if (item.feedbackFile != '' && item.feedbackFile != null) {
								item.feedbackFile = JSON.parse(item.feedbackFile)
							}
							return item
						})
					}

					if (res.data.taskItemList && res.data.taskItemList.length > 0 && res.data.taskItemList[0]
						.itemName != '') {
						this.mattersOptions = res.data.taskItemList
					} else {
						this.mattersOptions = []
					}

					if (res.data.feedbackList && res.data.feedbackList.length > 0) {
						this.feedbackList = res.data.feedbackList.map(item => {
							if (item.attachmentUrl != null && item.attachmentUrl != '') {
								item.attachmentUrl = JSON.parse(item.attachmentUrl)
							} else {
								item.attachmentUrl = []
							}
							return item
						})
					}
				});
			},
		}
	};
</script>

<style lang="scss" scoped>
	.time-line {
		width: 36px;
		display: flex;
		flex-direction: column;
		align-items: center;

		.dot {
			width: 12px;
			height: 12px;
			border-radius: 50%;
			background-color: #e8e8e8;
		}

		.lines {
			flex: 1;
			width: 1px;
			background-color: #e8e8e8;
		}

		.active {
			background-color: #1b5284;
		}

		.normal {
			background-color: #e8e8e8;
		}
	}


	.one-key-feedback {
		width: 120rpx;
		height: 120rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		// background-color: #2b65da;
		border-radius: 50%;
		font-size: 26rpx;
		color: #fff;
		font-weight: bold;
	}

	.warp {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
	}

	.file-content {
		.item {
			font-size: 24rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 12rpx 14rpx;
			border-radius: 8rpx;
			border: 1px solid #eee;
			margin-bottom: 10rpx;

			.txt {
				flex: 1;
				overflow: hidden;
				/*内容超出后隐藏*/
				text-overflow: ellipsis;
				/*超出内容显示为省略号*/
				white-space: nowrap;
				/*文本不进行换行*/
			}
		}
	}

	.custom-button {
		width: 160rpx;
		height: 54rpx;
		font-size: 24rpx;
		color: #fff;
		background: #3c9cff;
		border-radius: 6px;
		display: flex;
		align-items: center;
		justify-content: center;
	}



	.scroll-view_H {
		width: 100%;
		height: 100%;

		.staff-card {
			display: flex;
			align-items: center;
			padding: 20rpx;
			margin: 10rpx 20rpx;
			background-color: #fff;
			border-radius: 12rpx;
			box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.15);

			.left {
				flex: 1;
				display: flex;
				flex-direction: column;

				.top {
					margin-bottom: 30rpx;
				}

				.bottom {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.status {
						font-size: 24rpx;
						color: #fff;
						padding: 4rpx 10rpx;
						border-radius: 6rpx;
						background-color: #4F79DC;
					}
				}
			}
		}

		.submit-content {
			padding: 30rpx;
			height: 200rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
		}

		.other-staff {

			height: 80rpx;
			border: 1px dashed #1169DB;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 32rpx;
			color: #1169DB;
			font-weight: bold;
			margin: 0px 20rpx;
			border-radius: 6rpx;
		}

		.inCompany-task {
			display: flex;
			flex-direction: column;
			padding: 20rpx;


			.task-item {
				display: flex;
				align-items: center;
				padding: 20rpx 30rpx;
				background-color: #fff;
				border-radius: 12rpx;
				box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.15);

				.left {
					width: 100%;
					display: flex;
					flex-direction: column;

					.top {
						display: flex;
						padding-bottom: 20rpx;

						.label-content {
							width: 90px;
							font-size: 28rpx;
							color: #323232;
							font-weight: bold;
						}
					}
				}
			}
		}



	}
</style>